

<!DOCTYPE html>
<html>
  <head>
    	<base href="<%=basePath%>">

    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>用户中心：用户考试历史</title>
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="keywords" content="">
		<link rel="shortcut icon" href="resources/images/favicon.ico" />
		<link href="resources/bootstrap/css/bootstrap-huan.css" rel="stylesheet">
		<link href="resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
		<link href="resources/css/style.css" rel="stylesheet">
		
		<link href="resources/css/exam.css" rel="stylesheet">
		<link href="resources/chart/morris.css" rel="stylesheet">
      <!-- Javascript files -->
      <!-- jQuery -->
      <script type="text/javascript" src="/static/resources/js/jquery/jquery-1.9.0.min.js"></script>
      <script type="text/javascript" src="/static/js/layer/layui.all.js"></script>
      <script type="text/javascript" src="/static/js/laypage/laypage.js"></script>
      <script type="text/javascript" src="/static/js/vue/vue.min.js"></script>
      <script type="text/javascript" src="/static/js/vue/date.js"></script>
      <!-- Bootstrap JS -->
      <script type="text/javascript" src="/static/resources/bootstrap/js/bootstrap.min.js"></script>
		<style>
			a.btn{
				    margin-top: 0px; 
			}
		</style>
	</head>
	<body >
		<#--<header>
			<div class="container">
				<div class="row">
					<div class="col-xs-5">
						<div class="logo">
							<h1><a href="#"><img alt="" src="resources/images/logo.png"></a></h1>
						</div>
					</div>
					<div class="col-xs-7" id="login-info">
						<c:choose>
							<c:when test="${not empty sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}">
								<div id="login-info-user">
									
									<a href="user-detail/${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}" id="system-info-account" target="_blank">${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}</a>
									<span>|</span>
									<a href="j_spring_security_logout"><i class="fa fa-sign-out"></i> 退出</a>
								</div>
							</c:when>
							<c:otherwise>
								<a class="btn btn-primary" href="user-register">用户注册</a>
								<a class="btn btn-success" href="user-login-page">登录</a>
							</c:otherwise>
						</c:choose>
					</div>
				</div>
			</div>
		</header>-->
		<!-- Navigation bar starts -->

		<div class="navbar bs-docs-nav" role="banner">
			<div class="container">
				<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
					<ul class="nav navbar-nav">
						<li>
							<a href="/user/home"><i class="fa fa-home"></i>主页</a>
						</li>
						<li>
							<a href="/user/intopractice"><i class="fa fa-edit"></i>试题练习</a>
						</li>
						<li>
							<a href="/user/exam"><i class="fa  fa-paper-plane-o"></i>在线考试</a>
						</li>

						<li class="active">
							<a href="/intousercenter"><i class="fa fa-dashboard"></i>会员中心</a>
						</li>
						<li>
							<a href="/update"><i class="fa fa-cogs"></i>个人设置</a>
						</li>
					</ul>
				</nav>
			</div>
		</div>

		<!-- Navigation bar ends -->

		<!-- Slider starts -->

		<div>
			<!-- Slider (Flex Slider) -->

			<div class="container" style="min-height:500px;">

				<div class="row">
					<div class="col-xs-2">
						<ul class="nav default-sidenav">
							<li>
								<a href="/intousercenter"> <i class="fa fa-dashboard"></i> 用户中心 </a>
							</li>
							<#--<li>
								<a href="student/analysis"> <i class="fa fa-bar-chart-o"></i> 统计分析 </a>
							</li>-->
							<li class="active">
								<a href="/getuserexamhistory"> <i class="fa fa-history"></i> 考试历史 </a>
							</li>

						</ul>
					</div>
					<div class="col-xs-10">
						<div class="page-header">
							<h1><i class="fa fa-history"></i> 考试历史</h1>
						</div>
						<#--<div class="page-content row">
							<div id="question-list">
								<table class="table-striped table">
									<thead>
										<tr>
											<td>试卷名称</td><td>状态</td><td>类型</td><td>交卷时间</td><td>及格分</td><td>得分</td>
										</tr>
									</thead>
									<tbody>

									<#list userExamHistoryList as item>
                                           &lt;#&ndash; <option value="${item.businessNo?if_exists}">${item.businessName?if_exists}</option>&ndash;&gt;
									   <tr>

                                        <td>
											${item.examList.examName! }
                                        </td>
                                        <td>
											<#if item.approved! == 0>
											     <span class="label-warning label-sm label">未审核</span>
											</#if>
											<#if item.approved! == 1>
											     <span class="label-warning label-sm label">已审核</span>
											</#if>
											<#if item.approved! == 2>
											     <span class="label-warning label-sm label">已交卷</span>
											</#if>
											<#if item.approved! == 3>
											     <span class="label-warning label-sm label">已阅卷</span>
											</#if>
                                            &lt;#&ndash;<c:choose>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.approved == 0 }"><span class="label-warning label-sm label">未审核</span></c:when>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.approved == 1 }"><span class="label-default label-sm label">已审核</span></c:when>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.approved == 2 }"><span class="label-info label-sm label">已交卷</span></c:when>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.approved == 3 }"><span class="label-success label-sm label">已阅卷</span></c:when>&ndash;&gt;
                                            &lt;#&ndash;</c:choose>&ndash;&gt;
                                        </td>
                                        <td>
											<#if item.examList.examType! == 1>
											     <span class="label-warning label-sm label">私有考试</span>
										</#if>
											<#if item.examList.examType! ==2>
											<span class="label-warning label-sm label">公有考试</span>
											</#if>

											<#if item.examList.examType! == 3>
											     <span class="label-warning label-sm label">模拟考试</span>
											</#if>
                                            &lt;#&ndash;<c:choose>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.examType == 1 }">私有考试</c:when>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.examType == 2 }">公有考试</c:when>&ndash;&gt;
                                                &lt;#&ndash;<c:when test="${item.examType == 3 }">模拟考试</c:when>&ndash;&gt;
                                            &lt;#&ndash;</c:choose>&ndash;&gt;
                                        </td>
                                        <td>
                                            &lt;#&ndash;${item.examList.endTime}&ndash;&gt;
                                            &lt;#&ndash;<fmt:formatDate value="${item.submitTime }" pattern="yyyy-MM-dd HH:mm:ss"/>&ndash;&gt;
                                        </td>
                                        <td>
											&lt;#&ndash;${item.passPoint }&ndash;&gt; 60
                                        </td>
                                        <td>

                                            <#if item.pointGet! lt 60>
											     <font color="red">${item.pointGet! }</font>

                                             <#else >
											     <font color="green">${item.pointGet! }</font>

                                             </#if>
                                        </td>

                                    </tr>
									</#list>
									</tbody><tfoot></tfoot>
								</table>
							</div>
							&lt;#&ndash;<div id="page-link-content">&ndash;&gt;
								&lt;#&ndash;<ul class="pagination pagination-sm">${pageStr}</ul>&ndash;&gt;
							&lt;#&ndash;</div>&ndash;&gt;

						</div>

					</div>
				</div>
			</div>
		</div>-->

        <div class="container"　>
            <div class="col-xs-10" id="right-content" style="padding-top: 0px;">
                <div  class="container"　>
                    <div class="table-responsive" style="width:1050px;">

                        <div class="page-content" >

                            <div  >
                            <div id="app" >
                                <input type="text" v-if="false" value="HHHHHHHHHHHHH">
                                <table class="table-striped table" >
                                    <thead>
                                    <tr>
                                        <input type="text"  class="form-control" placeholder="考试名" id="examName" style="width: 100px;display: inline "/>&emsp;
                                        <input class="layui-input" placeholder="考试时间" type="text" id="startTime" readonly>&nbsp;
                                        <input class="btn btn-sm btn-info" type="button" id="queryExam" value="点击查询" onclick="getUserExamInfo()" />
                                    </tr>
                                    <tr class="warning">
                                        <td >序号</td>
                                        <td>我的考试</td>
                                        <td>考试时间</td>
                                        <td>我的班级</td>
                                        <td>我的成绩</td>
                                        <td>试卷总分</td>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr  v-for="(item,index) in userExamInfoResult">
                                        <td>{{index+1}}</td>
                                        <!--<td><a v-bind:href="'toExampast_userList?examId='+item.exam_id" target="_blank">{{item.exam_name}}</a></td>-->
                                        <td>{{item.exam_name}}</td>
                                        <td>{{item.create_time | DateFilter}}</td>
                                        <td>{{item.dep_name}}</td>
                                        <td>{{item.point}}</td>
                                        <td>{{item.totalpoint}}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <div id="pagenav5"></div>
                                        </td>
                                    </tr>
                                    </tbody>
                                    <tfoot>
                                    </tfoot>
                                </table>
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
		<footer>
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="copy">
							<p>
								ExamStack Copyright © <a href="http://www.examstack.com/" target="_blank">ExamStack</a> - <a href="resources" target="_blank">主页</a> | <a href="http://www.examstack.com/" target="_blank">关于我们</a> | <a href="http://www.examstack.com/" target="_blank">FAQ</a> | <a href="http://www.examstack.com/" target="_blank">联系我们</a>
							</p>
						</div>
					</div>
				</div>

			</div>

		</footer>

		<!-- Slider Ends -->


		<#--<script type="text/javascript" src="/static/resources/chart/raphael-min.js"></script>
		<script type="text/javascript" src="/static/resources/chart/morris.js"></script>-->


	</body>
</html>
<script type="text/javascript">
    Vue.filter("DateFilter", function (date) {
        var v = new Date(date);
        return formatDate(v, "yyyy-MM-dd HH:mm:ss");
    });


    var app = new Vue({
        el: '#app',
        data: {
            userExamInfoResult: []
        }
    });

    //时间选择
    layui.use('laydate', function () {
        var laydate = layui.laydate;

        //日期时间选择器
        laydate.render({
            elem: '#startTime'
            , type: 'datetime'
        });
    })






    function getExamDetail(examId){
        layer.open({
            type: 2,
            title: '查看考試信息',
            fix: false,
            skin: 'demo-class',
            maxmin: true,
            shadeClose: true,
            shade: 0.1,
            area: ['1200px', '700px'],
            left: '100px',
            content: '/view/toExampast_userList?examId='+examId,
            end: function () {
            }
        })
    }

    var getUserExamInfo =function (curr) {
        $.ajax({
            type: 'post',
            url: '/getUserExamInfo',
            data: {
                pageSize: 8,
                pageNum: curr || 1,
                examName:$("#examName").val(),
                startTime:$("#startTime").val()
            },
            dataType: 'json',
            success: function (msg) {
                app.userExamInfoResult = msg.page;
                console.log(msg);
                laypage({
                    cont: 'pagenav5', //分页容器
                    pages: msg.totalPage,//总页数
                    skin: "#333333",
                    first: "首页",
                    last: "尾页",
                    curr: curr || 1,
                    jump: function (obj, first) {
                        if (!first) {
                            getUserExamInfo(obj.curr);
                        }
                    }
                })
            },
            error: function () {
                alert("列表有误");
            }
        })
    }
    $(function () {
        getUserExamInfo();
    })

</script>